package uk.co.q3c.deplan.client.ui.component;

import uk.co.q3c.deplan.client.domain.DomainObject;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.CaptionPanel;
import com.googlecode.objectify.Key;

/**
 * @see ReferenceListWidget
 * @author David Sowerby 2 May 2010
 * 
 */
public class ReferenceWidget<T extends DomainObject> extends CaptionPanel {
	private String labelText;
	private final CommandButton button;
	private String targetToken;
	private Key<? extends DomainObject> key;

	/**
	 * Command for the button
	 * 
	 * @param cmd
	 */
	public ReferenceWidget() {
		super();
		button = new CommandButton();
	}

	public String getLabelText() {
		return labelText;
	}

	public void setLabelText(String labelText) {
		this.labelText = labelText;
	}

	public void setButtonCommand(Command command) {
		button.setCommand(command);
	}

	public String getTargetToken() {
		return targetToken;
	}

	public void setTargetToken(String targetToken) {
		this.targetToken = targetToken;
	}

	public Key<? extends DomainObject> getDataValue() {
		return key;
	}

	public void setDataValue(Key<? extends DomainObject> key) {
		this.key = key;
	}

}
